#region Copyright Notices
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Library General Public
// License as published by the Free Software Foundation; either
// version 2 of the License, or (at your option) any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
// Library General Public License for more details.
// 
// You should have received a copy of the GNU Library General Public
// License along with this library; if not, write to the Free
// Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
#endregion

using System;
using System.Runtime.Serialization;

namespace Yarr
{
	/// <summary>
	/// The class of exception thown by the evaluation process when
	/// an error is detected in user code
	/// </summary>
    [Serializable]
    public class YarrException : Exception
	{
        private YarrException () { }

        /// <summary>
        /// Create an exception with a specific error message
        /// </summary>
        /// <param name="message">The error message</param>
		public YarrException(string message) 
            : base(message)
		{
		}

        /// <summary>
        /// Wrap an exception with an YarrException
        /// </summary>
        /// <param name="message">The error message</param>
        /// <param name="e">The exception to wrap</param>
        public YarrException (string message, Exception e)
            : base(message, e)
        {
        }

        /// <summary>
        /// Serialize this object
        /// </summary>
        /// <param name="si"></param>
        /// <param name="sc"></param>
        protected YarrException (SerializationInfo si, StreamingContext sc)
            : base(si, sc)
        {
        }
	}
}